-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: move localnet monitoring to profile #2574
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughWalkthroughThe recent changes enhance the Docker Compose setup and monitoring capabilities of the application. A new variable Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DockerCompose
participant Grafana
participant Prometheus
participant Loki
participant Promtail
User->>DockerCompose: Start services
DockerCompose->>Prometheus: Initialize metrics collection
DockerCompose->>Loki: Initialize log storage
DockerCompose->>Grafana: Setup dashboards
DockerCompose->>Promtail: Configure log scraping
Promtail->>Docker: Discover containers
Promtail->>Loki: Push logs
Grafana->>Prometheus: Query metrics
Grafana->>Loki: Query logs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range, codebase verification and nitpick comments (4)
contrib/localnet/docker-compose.yml (4)
314-329
: Missingprometheus.yml
configuration fileThe
prometheus
service configuration indocker-compose.yml
specifies a volume mount for./prometheus/prometheus.yml
, but this file is missing. Please ensure that theprometheus.yml
file exists at the specified path and is correctly configured.
- Ensure the
prometheus.yml
file is present at./prometheus/prometheus.yml
.- Verify the correctness of the
prometheus.yml
configuration to avoid runtime issues.Analysis chain
Ensure proper volume mounting and dependency configuration for
prometheus
.The
prometheus
service is configured correctly with the necessary volumes and dependencies. Verify that theprometheus.yml
file exists in the specified path and is correctly configured.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence and correctness of Prometheus configuration file. # Test: Check if the prometheus.yml file exists. Expect: The file should exist. test -f ./prometheus/prometheus.yml && echo "prometheus.yml exists" || echo "prometheus.yml missing"Length of output: 92
295-313
: Missing Grafana configuration files and directoriesThe
datasource.yaml
file and thedashboards
directory specified in thegrafana
service configuration are missing. This will prevent the Grafana service from starting correctly. Please ensure the following:
- Create the
datasource.yaml
file at./grafana/datasource.yaml
with the necessary datasource configurations.- Create the
dashboards
directory at./grafana/dashboards
and populate it with the required dashboard configuration files.These steps are crucial for the proper functioning of the Grafana service.
Analysis chain
Ensure proper volume mounting and dependency configuration for
grafana
.The
grafana
service is configured correctly with the necessary volumes, ports, and dependencies. Verify that thedatasource.yaml
and dashboard files exist in the specified paths and are correctly configured.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence and correctness of Grafana configuration files. # Test: Check if the datasource.yaml file exists. Expect: The file should exist. test -f ./grafana/datasource.yaml && echo "datasource.yaml exists" || echo "datasource.yaml missing" # Test: Check if the dashboards directory exists. Expect: The directory should exist. test -d ./grafana/dashboards && echo "dashboards directory exists" || echo "dashboards directory missing"Length of output: 190
369-383
: Missingconfig.yaml
file forpromtail
serviceThe
config.yaml
file required for thepromtail
service is missing from the specified path (./promtail/config.yaml
). Please ensure that this configuration file is added to the correct location to allow thepromtail
service to function properly.
- Ensure the
config.yaml
file is present at./promtail/config.yaml
.- Verify the contents of the
config.yaml
file to ensure it is correctly configured for Promtail.Analysis chain
Ensure proper volume mounting and command configuration for
promtail
.The
promtail
service is configured correctly with the necessary volumes and command. Verify that theconfig.yaml
file exists in the specified path and is correctly configured.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence and correctness of Promtail configuration file. # Test: Check if the config.yaml file exists. Expect: The file should exist. test -f ./promtail/config.yaml && echo "config.yaml exists" || echo "config.yaml missing"Length of output: 81
330-355
: Missing health check configurations for dependencies ofzetachain-exporter
.The
zetacore0
andeth
services, which are dependencies forzetachain-exporter
, are missing health check configurations. This is crucial for ensuring that these services are running properly beforezetachain-exporter
starts.Please add appropriate health check configurations for the following services:
zetacore0
eth
This will ensure that the dependency conditions (
service_healthy
forzetacore0
andservice_started
foreth
) are reliably met.Analysis chain
Ensure proper environment variable configuration and dependency setup for
zetachain-exporter
.The
zetachain-exporter
service is configured correctly with the necessary environment variables and dependencies. Verify that the environment variables are set correctly and the services it depends on are available.
Verify the dependencies and health check configurations for
zetachain-exporter
.The environment variables for
zetachain-exporter
are correctly set. Now, verify that the dependencies (zetacore0
andeth
) are properly defined and configured with the necessary health checks.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the environment variables for zetachain-exporter. # Test: Check if the environment variables are set correctly. Expect: All variables should be set. env_vars=("ETH_EVM_URL" "ZETA_EVM_URL" "ZETA_LCD_URL" "ZETA_TENDERMINT_URL" "ETH_CHAIN_ID" "ZETA_CHAIN_ID" "REFRESH_INTERVAL" "FAST_REFRESH_INTERVAL") for var in "${env_vars[@]}"; do grep -q "$var" contrib/localnet/docker-compose.yml && echo "$var is set" || echo "$var is missing" doneLength of output: 1316
Script:
#!/bin/bash # Description: Verify the definitions and health check configurations for dependencies of zetachain-exporter. # Test: Check if zetacore0 and eth services are defined and have health checks configured. services=("zetacore0" "eth") for service in "${services[@]}"; do echo "Checking service: $service" grep -A 10 "$service:" contrib/localnet/docker-compose.yml | grep -q "healthcheck" && echo "$service has health check configured" || echo "$service is missing health check configuration" doneLength of output: 572
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (5)
- Makefile (4 hunks)
- contrib/localnet/docker-compose.yml (1 hunks)
- contrib/localnet/grafana/dashboards/log_browser.json (1 hunks)
- contrib/localnet/grafana/datasource.yaml (1 hunks)
- contrib/localnet/promtail/config.yaml (1 hunks)
Additional context used
yamllint
contrib/localnet/promtail/config.yaml
[error] 12-12: trailing spaces
(trailing-spaces)
contrib/localnet/grafana/datasource.yaml
[error] 20-20: no new line character at the end of file
(new-line-at-end-of-file)
Additional comments not posted (22)
contrib/localnet/promtail/config.yaml (4)
1-3
: LGTM!The server configuration for HTTP and gRPC ports is correctly set.
5-6
: LGTM!The positions configuration is correctly set to
/tmp/positions.yaml
.
8-9
: LGTM!The client URL for Loki is correctly set to
http://loki:3100/loki/api/v1/push
.
11-19
: LGTM!The scrape configuration for Docker containers is correctly set.
Tools
yamllint
[error] 12-12: trailing spaces
(trailing-spaces)
contrib/localnet/grafana/datasource.yaml (2)
Line range hint
1-16
:
LGTM!The Prometheus data source configuration remains unchanged and is correctly set.
Tools
yamllint
[error] 20-20: no new line character at the end of file
(new-line-at-end-of-file)
17-20
: LGTM!The Loki data source configuration is correctly set.
Tools
yamllint
[error] 20-20: no new line character at the end of file
(new-line-at-end-of-file)
contrib/localnet/grafana/dashboards/log_browser.json (7)
2-21
: LGTM!The annotations configuration is correctly set.
24-24
: LGTM!The description of the dashboard is clear and concise.
31-163
: LGTM!The panels configuration for Prometheus and Loki data sources is correctly set.
165-165
: LGTM!The refresh interval is correctly set to 5 seconds.
169-201
: LGTM!The templating configuration for Loki data sources is correctly set.
202-204
: LGTM!The time range is correctly set from
now-30m
tonow
.
208-208
: LGTM!The title of the dashboard is correctly set to
Log Browser
.contrib/localnet/docker-compose.yml (2)
387-387
: Ensure proper definition of volumegrafana_storage
.The
grafana_storage
volume is defined correctly. Verify that it is used appropriately in thegrafana
service.
357-368
: Ensure proper command configuration forloki
.The
loki
service is configured correctly with the necessary command. Verify that thelocal-config.yaml
file exists in the specified path and is correctly configured.Makefile (7)
7-9
: Introduction ofDOCKER_COMPOSE
variable.The
DOCKER_COMPOSE
variable is defined correctly and enhances flexibility by allowing additional arguments to be passed to Docker Compose.
215-215
: Usage ofDOCKER_COMPOSE
variable instart-localnet-skip-build
.The
DOCKER_COMPOSE
variable is used correctly to start the localnet.
219-219
: Usage ofDOCKER_COMPOSE
variable instop-localnet
.The
DOCKER_COMPOSE
variable is used correctly to stop the localnet.
242-242
: Usage ofDOCKER_COMPOSE
variable instart-e2e-test
.The
DOCKER_COMPOSE
variable is used correctly to start the e2e test.
247-247
: Usage ofDOCKER_COMPOSE
variable instart-e2e-admin-test
.The
DOCKER_COMPOSE
variable is used correctly to start the e2e admin test.
252-252
: Usage ofDOCKER_COMPOSE
variable instart-e2e-performance-test
.The
DOCKER_COMPOSE
variable is used correctly to start the e2e performance test.
296-296
: Usage ofDOCKER_COMPOSE
variable instart-upgrade-test
.The
DOCKER_COMPOSE
variable is used correctly to start the upgrade test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Lucas Bertrand <[email protected]>
* fix(ci): use static preparams for zetaclient by default (#2587) * refactor: move localnet monitoring to profile (#2574) Co-authored-by: Lucas Bertrand <[email protected]> * fix(e2e): update performance test parameters and bump go-tss (#2563) * fix(e2e): increase performance test timeouts * bump go-tss * fix(ci): remove job concurrency (#2595) * ci: run on PRs to all base branches --------- Co-authored-by: Lucas Bertrand <[email protected]>
Description
Move monitoring stack to a profile. Now you can easily turn on monitoring with
export COMPOSE_ARGS='--profile monitoring'
for any docker compose job.Also add loki and promtail to allow working with logs. Add a simple log dashboard to allow exploration:
Summary by CodeRabbit
New Features
Bug Fixes